<template>
  <view>年龄:{{ age }}</view>
  <button @click="handleAdd">增加</button>
</template>

<script setup lang="ts">
import { ref, reactive, toRef, toRefs } from "vue";
let person = reactive({
  uname: "张三",
  age: 21,
});

let { uname, age } = toRefs(person);
// console.log(uname,age)

const handleAdd = function () {
  age.value += 1;
};

// // let name = person.uname;
// // let { uname } = person;
// let uname = toRef(person, "uname");
// // console.log(uname)

// "uname"|"age"
</script>

<style style="less" scoped></style>
